package practice04;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: practice04
 * @ClassName: Student
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/11 19:30
 * @Copyright 大牛版板所有
 */
public class Student implements IComparable {
    private String stuNo;
    private String name;
    private int age;
    private int score;

    public Student() {
    }

    public Student(String stuNo, String name, int age, int score) {
        this.stuNo = stuNo;
        this.name = name;
        this.age = age;
        this.score = score;
    }

    public String getStuNo() {
        return stuNo;
    }

    public void setStuNo(String stuNo) {
        this.stuNo = stuNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    @Override
    public int compareTo(Object object){
        Student student = (Student)object;
        if (this.score == student.getScore()){
            return 0;
        }
        else if (this.score > student.getScore()){
            return 1;
        }
        return -1;
    }
}
